<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>lineto</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="linenr.html" title="linenr" />
    <link rel="next" href="linrand.html" title="linrand" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">lineto</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="linenr.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="linrand.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="lineto"></a>
      <div class="titlepage"></div>
      <a id="IndexLineto" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">lineto</span>
        </h2>
        <p>lineto — 
      Generate glissandos starting from a control signal.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp118914272"></a>
        <h2>Description</h2>
        <p>
      Generate glissandos starting from a control signal.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp118957648"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">kres <span class="command"><strong>lineto</strong></span> ksig, ktime</pre>
      </div>
      <div class="refsect1">
        <a id="idp118959856"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>kres</em></span> -- Output signal.
    </p>
        <p>
      <span class="emphasis"><em>ksig</em></span> -- Input signal.
    </p>
        <p>
      <span class="emphasis"><em>ktime</em></span> -- Time length of glissando in seconds.
    </p>
        <p>
      <span class="emphasis"><em>lineto</em></span> adds glissando (i.e. straight lines) to a stepped input signal (for example, produced by <a class="link" href="randh.html" title="randh"><em class="citetitle">randh</em></a> or <a class="link" href="lpshold.html" title="lpshold"><em class="citetitle">lpshold</em></a>).  It generates a straight line starting from previous step value, reaching the new step value in <span class="emphasis"><em>ktime</em></span> seconds. When the new step value is reached, such value is held until a new step occurs. Be sure that <span class="emphasis"><em>ktime</em></span> argument value is smaller than the time elapsed between two consecutive steps of the original signal, otherwise discontinuities will occur in output signal.
    </p>
        <p>
      When used together with the output of <a class="link" href="lpshold.html" title="lpshold"><em class="citetitle">lpshold</em></a> it emulates the glissando effect of old analog sequencers.
    </p>
        <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Note">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Note]" src="images/note.png" />
              </td>
              <th align="left">Note</th>
            </tr>
            <tr>
              <td align="left" valign="top">
                <p>No new value for <span class="emphasis"><em>ksig</em></span> or <span class="emphasis"><em>ktime</em></span> will have effect until the previous <span class="emphasis"><em>ktime</em></span> has elapsed.</p>
              </td>
            </tr>
          </table>
        </div>
      </div>
      <div class="refsect1">
        <a id="idp118970576"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the lineto opcode. It uses the file <a class="ulink" href="examples/lineto.csd" target="_top"><em class="citetitle">lineto.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp118972432"></a>
          <p class="title">
            <strong>Example 422. Example of the lineto opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
-odac      <span class="comment">;;;realtime audio out</span>
<span class="comment">;-iadc    ;;;uncomment -iadc if realtime audio input is needed too</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o lineto.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">ksmps</span> <span class="op">=</span> 32
<span class="ohdr">nchnls</span> <span class="op">=</span> 2
<span class="ohdr">0dbfs</span>  <span class="op">=</span> 1

giSine <span class="ohdr">ftgen</span> 0, 0, 2^10, 10, 1

<span class="oblock">instr</span> 1

kfreq     <span class="opc">randh</span>     1000, 20, 2, 1, 2000 <span class="comment">;generates ten random number between 100 and 300 per second</span>
kpan      <span class="opc">randh</span>     .5, 1, 2, 1, .5   <span class="comment">;panning between 0 and 1</span>
kp        <span class="opc">lineto</span>    kpan, .5          <span class="comment">;smoothing pan transition</span>
aout      <span class="opc">poscil</span>    .4, kfreq, giSine
aL, aR    <span class="opc">pan2</span>      aout, kp
          <span class="opc">outs</span>      aL, aR

<span class="oblock">endin</span>
<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>

<span class="stamnt">i</span> 1 0 10
<span class="stamnt">e</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp118976720"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="tlineto.html" title="tlineto"><em class="citetitle">tlineto</em></a>
    </p>
      </div>
      <div class="refsect1">
        <a id="idp118978768"></a>
        <h2>Credits</h2>
        <p>Author: Gabriel Maldonado</p>
        <p>New in Version 4.13</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="linenr.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="linrand.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">linenr </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> linrand</td>
        </tr>
      </table>
    </div>
  </body>
</html>
